package cn.yunhe.action;

import cn.yunhe.biz.NewsBiz;
import cn.yunhe.pojo.News;

import java.util.List;

public class NewsAction extends BasicAction {
    private NewsBiz newsBiz;


    public String getAllNews() throws Exception {
        List<News> newsList = newsBiz.getAllNews();
        getMapSession().put("newsList",newsList);
        return SUCCESS;
    }

    public  String searchNews(){
        News news = new News();
        news.setTitle("新闻");
        news.setBoardId(3);
        List<News> newsList = newsBiz.getNews(news);
        getMapSession().put("newsList",newsList);
        return SUCCESS;
    }

    public NewsBiz getNewsBiz() {
        return newsBiz;
    }

    public void setNewsBiz(NewsBiz newsBiz) {
        this.newsBiz = newsBiz;
    }
}
